package com.atguigu.feign;

import com.atguigu.entity.CartInfo;
import com.atguigu.result.RetVal;
import com.atguigu.util.AuthContextHolder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "shop-cart")
public interface CartFeignClient {
    @PostMapping("cart/addToCart/{skuId}/{skuNum}")
    public RetVal addToCart(@PathVariable Long skuId, @PathVariable Integer skuNum);

    //查询选中的商品信息
    @GetMapping("cart/getSelectedProduct/{userId}")
    public List<CartInfo> getSelectedProduct(@PathVariable String userId);

    //从数据库中查询购物车缓存信息
    @GetMapping("cart/queryFromDbToRedis/{userId}")
    public List<CartInfo> queryFromDbToRedis(@PathVariable String userId);
}
